package com.myaxuan.service.permissions.impl;

import com.myaxuan.configuration.dynamicdatasource.DataSourceContextHolder;
import com.myaxuan.entity.permissions.User;
import com.myaxuan.mapper.permissions.UserMapper;
import com.myaxuan.service.permissions.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by pc255 on 2018/1/31.
 */
@Service
public class UserServiceImpl implements UserService{

	@Autowired
	private UserMapper userMapper;

	@Autowired
	private StringRedisTemplate stringRedisTemplate;

	@Autowired
	private RedisTemplate redisTemplate;

	@Override
	public List<User> findAll(Integer page,Integer limit) {
		return userMapper.findAll( page, limit);
	}

	@Override
	public int insertSelective(User record) {
		return userMapper.insertSelective(record);
	}

	@Override
	public int deleteByPrimaryKey(String userId) {
		return userMapper.deleteByPrimaryKey(userId);
	}

	@Override
	public User selectByPrimaryKey(String id) {
		return userMapper.selectByPrimaryKey(id);
	}

	@Override
	public int updateByPrimaryKeySelective(User record) {
		return userMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public User login(String account) {
		return userMapper.login(account);
	}
}
